package cn.itcast.n3_Java线程;

/**
 * @program: juc
 * @description:
 * @author: flyduck
 * @create: 2024-08-28 16:49
 **/
public class Test12_$$$$$_sleep应用_while循环时防止cpu占用率为100 {
    public static void main(String[] args) {
        new Thread(){
            @Override
            public void run() {
                while (true) {
                    try {
                        Thread.sleep(1);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        }.start();
    }
}
